package com.ccl.service.impl;

import com.ccl.dao.StatisticMapper;
import com.ccl.entity.Statistic;
import com.ccl.service.StatisticService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class StatisticServiceImpl implements StatisticService {
    @Autowired
    private StatisticMapper statisticMapper;
    @Override
    public List<Statistic> findHeadData() {

        return statisticMapper.findHeadData();
    }
    //根据id更新文章点击量+1
    @Override
    public void updateHits(Integer articleId) {
        statisticMapper.updateHits(articleId);
    }
}
